<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="format-detection" content="telephone=no,email=no,adress=no">
<link href="<%=request.getContextPath()%>/css/global.css" type="text/css" rel="stylesheet" />
<link href="<%=request.getContextPath() %>/js/easyui/themes/metro/easyui.css" type="text/css" rel="stylesheet"/>
<link href="<%=request.getContextPath() %>/js/date/skin/WdatePicker.css" type="text/css" rel="stylesheet"/>
<link href="<%=request.getContextPath()%>/js/autocomplate/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/global.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/easyui/easyui.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/date/WdatePicker.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/validate/validate.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/autocomplate/jquery.autocomplete.js"></script>
<script type="text/javascript">
	
	$(function() {
		
		$('#merNo').autocomplete({
			serviceUrl: '<%=request.getContextPath()%>/merchant_auto.html',
			minChars:1,
			paramName:'merNo',
			transformResult: function(response) {
			　　return {
			　　　　suggestions: $.map($.parseJSON(response), function(dataItem) {
			　　　　　　return { value: dataItem.merNo, data: dataItem.merName};
			　　　　})
			　　};
			},
			formatResult:function (suggestion, currentValue) {
				return "[" + suggestion.value.replace(currentValue,"<strong>"+currentValue+"</strong>")+ "]" + suggestion.data;
			}
		});
		
		$("#sform").validate({
			rules : {
				rskNo : {
					required : true
				},
				merNo : {
					required : true
				},
				rskTarget : {
					required : true
				},
				rskAddition : {
					required : true
				},
				rskCondition : {
					required : true
				},
				rskScope : {
					required : true
				},
				rskPay : {
					required : true
				},
				rskDay : {
					required : true
				},
				rskCount : {
					required : true
				},
				rskPolicy : {
					required : true
				},
				rskCode : {
					required : true
				},
				rskMessage : {
					required : true
				},
				rskState : {
					required : false
				},
				rskDate : {
					required : true
				},
				rskRemark : {
					required : false
				}
			},
			errorPlacement : function(error, element) {
				element.css("border-color", "#1c3e57");
			},
		});
	});
</script>
</head>
<body>
	<div class="easyui-panel" title="编辑面板" style="width: 100%;" data-options="fit:true">
		<form id="sform" action="risk_save.html" method="post" enctype="multipart/form-data">
			<input type="hidden" placeholder="编号" name="rskNo" id="rskNo" value="<s:property value="riskBean.rskNo"/>" />
			<table width="90%">
				<tr>
					<td height="30" align="right" width="200"><b></b></td>
					<td width="300"><b>内容</b></td>
					<td><b>说明</b></td>
				</tr>
				<tr>
					<td></td>
					<td colspan="2"><hr /></td>
				</tr>
				<tr>
					<td height="30" align="right">商户编号 :</td>
					<td><input type="text" placeholder="商户编号" name="merNo" id="merNo" value="<s:property value="riskBean.merNo"/>" /></td>
					<td><input type="button" value="缺省模版"  class="submit" onclick="if($('#merNo').val())(location.href='<%=request.getContextPath()%>/risk_savedefault.html?merNo='+$('#merNo').val())"/>&nbsp;&nbsp;按照此商户编号生成缺省风控规则</td>
				</tr>
				<tr>
					<td height="30" align="right">风控目标 :</td>
					<td colspan="2"><s:checkboxlist id="rskTarget" name="rskTarget" list="#{'持卡人IP':'持卡人IP','持卡人卡号':'持卡人卡号','持卡人邮箱':'持卡人邮箱','持卡人电话':'持卡人电话','持卡人地址':'持卡人地址'}" value="#{'持卡人IP','持卡人卡号','持卡人邮箱','持卡人电话','持卡人地址'}"></s:checkboxlist></td>
				</tr>
				<tr>
					<td height="30" align="right">是否附加 :</td>
					<td><s:radio id="rskAddition" name="rskAddition" list="#{'否':'否','是':'是'}" value="#{'否'}"></s:radio></td>
					<td>如果附加条件,风控规则将按照附加条件出现的次数来判定,而不是风控目标出现的次数来判定</td>
				</tr>
				<tr>
					<td height="30" align="right">附加条件 :</td>
					<td><s:radio id="rskCondition" name="rskCondition" list="#{'IP次数':'IP次数','卡号次数':'卡号次数','邮箱次数':'邮箱次数'}" value="#{'IP次数'}"></s:radio></td>
					<td>次数是指更换该项参数的次数,比如同一个IP的用户在指定范围内换卡号次数 附加条件不能和风控目标一致,否则出现的次数必为1次,无法进行风险控制</td>
				</tr>
				<tr>
					<td height="30" align="right">交易范围 :</td>
					<td><s:radio id="rskScope" name="rskScope" list="#{'商户范围':'商户范围','子账户范围':'子账户范围','网站范围':'网站范围'}" value="#{'商户范围'}"></s:radio></td>
					<td>对某种交易字段进行风险控制 商户范围是指对某个商户的交易起作用,子账户是对商户名下子账户的交易起作用,网站范围是指对某个网站起作用</td>
				</tr>
				<tr>
					<td height="30" align="right">交易状态 :</td>
					<td><s:radio id="rskPay" name="rskPay" list="#{'成功交易':'成功交易','全部交易':'全部交易'}" value="#{'成功交易'}"></s:radio></td>
					<td>全部是指在全部的交易里面筛选,成功是指只在付款成功的交易内筛选,失败是指只在付款失败的交易内筛选</td>
				</tr>
				<tr>
					<td height="30" align="right">交易天数 :</td>
					<td><input type="text" placeholder="交易天数" style="width: 60px;" name="rskDay" id="rskDay" value="<s:text name="global.format.count"><s:param value="riskBean.rskDay"/></s:text>" />(天)</td>
					<td>是指在多少天内发生的交易中进行过滤,比如1天内有过成功1次的交易则不允许重复支付</td>
				</tr>
				<tr>
					<td height="30" align="right">风险次数 :</td>
					<td><input type="text" placeholder="风险次数" style="width: 60px;" name="rskCount" id="rskCount" value="<s:text name="global.format.count"><s:param value="riskBean.rskCount"/></s:text>" />(次)</td>
					<td>是指符合风险条件的记录数量,比如换卡超过3次等</td>
				</tr>
				<tr>
					<td height="30" align="right">风险策略 :</td>
					<td><s:radio id="rskPolicy" name="rskPolicy" list="#{'警告':'警告','阻止':'阻止'}" value="#{'阻止'}"></s:radio></td>
					<td>对于符合风险判定的交易的处理策略 ,警告不会影响交易的进行,只会进行报警提示,阻止则会中断交易的进行</td>
				</tr>
				<tr>
					<td height="30" align="right">风险代码 :</td>
					<td><input type="text" placeholder="风险代码" name="rskCode" id="rskCode" style="width: 240px;" value="<s:property value="riskBean.rskCode"/>" /></td>
					<td>持卡人看到的错误码(系统默认模版为R001-R099,建议自定义规则从R101开始编码)</td>
				</tr>
				<tr>
					<td height="30" align="right">风险描述 :</td>
					<td><input type="text" placeholder="风险描述" name="rskMessage" id="rskMessage" style="width: 240px;" value="<s:property value="riskBean.rskMessage"/>" /></td>
					<td>持卡人看到的风控提示信息(默认不对持卡人提示明确的风险信息,缺省以High Risk作为风险描述)</td>
				</tr>

				<tr>
					<td height="30" align="right">是否可用 :</td>
					<td><s:radio id="rskState" name="rskState" list="#{'0':'无效','1':'有效'}" value="1"></s:radio></td>
					<td>是否可用</td>
				</tr>
				<tr>
					<td height="30" align="right">备注 :</td>
					<td><input type="text" placeholder="备注" style="width: 240px;" name="rskRemark" id="rskRemark" value="<s:property value="riskBean.rskRemark"/>" /></td>
					<td>对此风控策略的备注(商户可以在拦截记录内看到)</td>
				</tr>


				<tr>
					<td></td>
					<td colspan="2"><hr /></td>
				</tr>

				<tr>
					<td height="30" align="right"></td>
					<td><input type="button" class="submit" value="提交单据" onclick="if($('#sform').valid()){$('#sform').submit();}" /> <input type="button" class="submit" value="返回上级" onclick="history.go(-1);" /></td>
					<td></td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>

